package admin.member.level.action;

import java.sql.SQLException;

import admin.member.level.dao.LevelDao;
import admin.member.level.dto.LevelDto;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;

@SuppressWarnings("serial")
public class WriteAction extends ActionSupport implements Preparable, ModelDriven {
	private LevelDao dao;
	private LevelDto dto;

	public WriteAction() {
		dao = LevelDao.getInstance();
	}
	
	public String execute() throws SQLException {
		dao.insert(dto);
		
		return SUCCESS;
	}
	
	@Override
	public Object getModel() {
		return dto;
	}
	@Override
	public void prepare() throws Exception {
		dto = new LevelDto();
	}
}
